<script setup>
import { useRouter } from 'vue-router'
import TreeMenu from './treeMenu.vue';
import { ref, computed } from 'vue';
import { useStore } from 'vuex'

const store = useStore()
const router = useRouter()
// const menuData = ref(router.options.routes[0].children)
const menuData = computed(() => {
  return store.state.menu.routerList
})

const isCollapse = computed(() => {
  return store.state.menu.isCollapse
})

const active = computed(() => {
  return store.state.menu.menuActive
})
</script>

<template>
  <el-menu  active-text-color="#ffd04b" background-color="#545c64"
    class="aside-container" text-color="#fff"
    :collapse="isCollapse" :default-active="active">
    <p class="logo-lg">{{ isCollapse ? 'DIDI' : 'DIDI陪诊' }}</p>
    <TreeMenu :menuData="menuData" :index="1"></TreeMenu>
  </el-menu>
</template>

<style lang="less" scoped>
.aside-container {
  height: 100%;

  .logo-lg {
    font-size: 20px;
    text-align: center;
    height: 50px;
    line-height: 50px;
    color: #fff;
  }
}
</style>
